﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace AWA.VAT.EmailApp
{
    internal static class Configuration
    {
        public static string FileLocation { get; set; }

        public static short Year { get; set; } // populate by entry or from config file?

        private static string _emailUsername;
        public static string EmailUsername
        {
            get
            {
                if (String.IsNullOrEmpty(_emailUsername))
                    return null;
                else if (_emailUsername.Contains('@'))
                    return _emailUsername;
                else
                    return _emailUsername + "@gmail.com";
            }
            set { _emailUsername = value; }
        }

        public static string EmailPassword { get; set; }

        public static string EmailDomain
        {
            get { return ConfigurationManager.AppSettings["EmailDomain"]; }
        }

        public static string SMTPHost
        {
            get { return ConfigurationManager.AppSettings["SMTPHost"]; }
        }

        public static int SMTPPort
        {
            get { return int.Parse(ConfigurationManager.AppSettings["SMTPPort"]); }
        }

        public static string MessageSubject
        {
            get { return ConfigurationManager.AppSettings["MessageSubject"]; }
        }

        public static string MessageGreeting
        {
            get { return ConfigurationManager.AppSettings["MessageGreeting"]; }
        }

        public static string MessagePara1
        {
            get { return ConfigurationManager.AppSettings["MessagePara1"]; }
        }

        public static string MessageInfoOnFile
        {
            get { return ConfigurationManager.AppSettings["MessageInfoOnFile"]; }
        }

        public static string MessageCheckIn
        {
            get { return ConfigurationManager.AppSettings["MessageCheckIn"]; }
        }

        public static string MessageClosing
        {
            get { return ConfigurationManager.AppSettings["MessageClosing"]; }
        }

        public static string MessageSenderName
        {
            get { return ConfigurationManager.AppSettings["MessageName"]; }
        }

        public static string MessageSenderTitle
        {
            get { return ConfigurationManager.AppSettings["MessageTitle"]; }
        }
    }
}
